package com.buka.dao;

import com.buka.entity.User;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * 当期接口操作的是  user表
 */
public interface UserDao {

    //查询用户总数
    //select count(1) from user
    int count();

    int save();

    User selectUser();

    List<User> list();

    List<Map<String, Object>> groupBySex();

    Map<String,Object> selectMap();

    List<Map<String,Object>> listMap();

    User selectById(Integer id);

    //select * from user where sex = #{sex} and userName = #{userName}
    User selectBySexAndUserName(@Param("sex") int sex, @Param("userName") String userName);
//    User selectBySexAndUserName(int sex, String userName);

    User selectByUser(User user);

    User selectByMap(Map userMap);

    //userName 在map集合中
    //passwd  在user对象中
    User selectByCondition(@Param("map") Map map,@Param("user") User user);

    //修改数据 updateById   int 0
    int updateById(User user);

    //插入新记录 一条记录就是一个对象
    int add(@Param("user1") User user1,@Param("user2") User user2);


    List<User> userRoleList();


}
